
<!--
/**************************************************
* @ orderreview.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/02/12, Simonyi Peng
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>

<html>
<head>
<title>采购量月度汇总表</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>

<%
ArrayList deptList = new ArrayList();
ArrayList addrList = new ArrayList();

ArrayList ary = (ArrayList)request.getAttribute("organdaddr");
deptList = (ArrayList)ary.get(0);


SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMM");
String date = sdf.format(new java.util.Date(System.currentTimeMillis()));
String year = date.substring(0,4);
String month = date.substring(4);

GSOperatorBean operatorBean = (GSOperatorBean)session.getAttribute(GSBaseConstants.LOGIN);

String msg = (String)session.getAttribute("MSG");
session.removeAttribute("MSG");
if(msg != null){
%>

<script language='javascript'>
	alert("<%=msg%>");
</script>
<%
}
%>

<script>
	var counter;
	function process(val1,val2	){

		if(val1%10 == '1'){
			var balyear = document.getElementById("balanceyear"+val1).value;
			var balmonth = document.getElementById("balancemonth"+val1).value;
			if(balyear == null || balyear == "")
			{
				alert("请选择结算年份");
				return false;
			}else
			{
				if(balmonth == null || balmonth == "")
				{
					alert("请选择结算月份");
					return false;
				}else
				{
				document.all.begindate.value=document.getElementById("balanceyear"+val1).value;
				document.all.enddate.value=document.getElementById("balancemonth"+val1).value;
				document.all.querytype.value='1';
				}
			}
			
		}
		if(val1%10 == '2'){
			document.all.begindate.value=document.getElementById("balancestartdate"+val1).value;
			document.all.enddate.value=document.getElementById("balanceenddate"+val1).value;
			document.all.querytype.value='2';
		}
		
		if(val1 < 30){
			document.all.deptno.value = document.getElementById("deptid"+val1).value;
			document.all.depttype.value = "1";
		}
		else{
			if(document.getElementById("providerid"+val1).value == null || document.getElementById("providerid"+val1).value == ""){
				alert("请输入供应商");
				return false;
			}
			document.all.deptno.value = document.getElementById("providerid"+val1).value;
			document.all.depttype.value = "2";
		}
		
		document.all.filetitle.value = val1;
		orderreivewform.action = "<%=response.encodeURL(request.getContextPath() + "/A300202.do")%>";
		orderreivewform.submit();
		

	}
	
</script>
</head>
<%
	ArrayList tList = new ArrayList();
	String [] tStr = null;
	String[][] years = GSBaseManager.getBalanceYears();
	String[][] months = GSBaseManager.getBalanceMonths();
	String[] balanced = GSBaseManager.getBalanceDate();

%>
<body BGCOLOR="#f2f2f2"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

<form name="orderreivewform" method="post" >
<input type='hidden' name='begindate' value=''>
<input type='hidden' name='enddate' value=''>
<input type='hidden' name='deptno' vlaue=''>
<input type='hidden' name='depttype' vlaue=''>
<input type='hidden' name='filetitle' vlaue=''>
<input type='hidden' name='querytype' value=''>


<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" class="mtxt_black">采购量月度汇总表</td>
          <td height="30" align="left"><font color="red">(注意：如生成报表有问题，请用Office2000以上版本，或尽量选择查询条件。)</font></td>	
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black2">订货单位采购明细表</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<BR>

	<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center width='80'>采购单位</TD>
					<TD align=left class="bg_row_odd">
						<select name="deptid11" >

						<%	
						//System.out.println("aaa'''");
						if(operatorBean!=null)
						{
								//System.out.println(operatorBean.getGs_oper_org_id());
						}		

								if (operatorBean.getGs_oper_org_id().substring(2,4).equals("00"))
								{
							%>
									<option value='<%=operatorBean.getGs_oper_org_id()%>'>--全部--</option>
							<%
								}


						%>
                    		<%
                    		for(int i=0;i<deptList.size();i++){
                    			String dept = (String)deptList.get(i);
						        StringTokenizer st = new StringTokenizer(dept,"|");
						        String[] tmp = new String[2] ;
						        int index =0;
						        while(st.hasMoreElements()){
						            tmp[index++] = (String)st.nextElement();
						        }
                    		%>
                        		<option value='<%=tmp[0]%>' ><%=tmp[1]%></option>
                    		<%
                    		}
                    		%>					
						</select>
					</TD>
					<TD class="bg_column" align=center>选择结算月份</TD>
					<TD align=left class="bg_row_odd">
						<select name="balanceyear11" >
							<option value=''>请选择&nbsp;</option>
							<%

								for(int i=0;i<years.length;i++){
							%>						
									<option value='<%=years[i][0]%>' <%if(year.equals(years[i][0])) out.print("selected");%>><%=years[i][1]%></option>
							<%
								}
							%>
						</select>
						<select name="balancemonth11" >
							<option value=''>请选择&nbsp;</option>
							<%
								for(int i=0;i<months.length;i++){
							%>						
									<option value='<%=months[i][0]%>' <%if(month.equals(months[i][0])) out.print("selected");%>><%=months[i][1]%></option>
							<%
								}
							%>
						</select>

					</TD>
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(11,1)'>
					</td>
				</tr>
				<tr>
					<TD class="bg_column" align=center width='80'>采购单位</TD>
					<TD align=left class="bg_row_odd">
						<select name="deptid12">
						
						<%	

								if (operatorBean.getGs_oper_org_id().substring(2,4).equals("00"))
								{
							%>
									<option value='<%=operatorBean.getGs_oper_org_id()%>'>--全部--</option>
							<%
								}

						%>
                    		<%
                    		for(int i=0;i<deptList.size();i++){
                    			String dept = (String)deptList.get(i);
						        StringTokenizer st = new StringTokenizer(dept,"|");
						        String[] tmp = new String[2] ;
						        int index =0;
						        while(st.hasMoreElements()){
						            tmp[index++] = (String)st.nextElement();
						        }
                    		%>
                        		<option value='<%=tmp[0]%>' ><%=tmp[1]%></option>
                    		<%
                    		}
                    		%>					
						</select>
					</TD>

					<TD class="bg_column" align=center>选择时间段</TD>					
					<TD align=left class="bg_row_odd">
						<input type="text" onfocus='setday(this)' name="balancestartdate12" size='10' value="<%=balanced[0]%>">
						~
						<input type="text" onfocus='setday(this)' name="balanceenddate12" size='10' value="<%=balanced[1]%>">
					</TD>										
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(12,1)'>
					</td>
				</TR>
			</table>
		</td>
	</tr>
</table>
<BR>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black2">订货单位采购汇总表</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<BR>

	<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center width='80'>采购单位</TD>
					<TD align=left class="bg_row_odd">
						<select name="deptid21">
												
						<%	

								if (operatorBean.getGs_oper_org_id().substring(2,4).equals("00"))
								{
							%>
									<option value='<%=operatorBean.getGs_oper_org_id()%>'>--全部--</option>
							<%
								}


						%>
                    		<%
                    		for(int i=0;i<deptList.size();i++){
                    			String dept = (String)deptList.get(i);
						        StringTokenizer st = new StringTokenizer(dept,"|");
						        String[] tmp = new String[2] ;
						        int index =0;
						        while(st.hasMoreElements()){
						            tmp[index++] = (String)st.nextElement();
						        }
                    		%>
                        		<option value='<%=tmp[0]%>' ><%=tmp[1]%></option>
                    		<%
                    		}
                    		%>					
						</select>
					</TD>
					<TD class="bg_column" align=center>选择结算月份</TD>
					<TD align=left class="bg_row_odd">
						<select name="balanceyear21" >
							<option value=''>请选择&nbsp;</option>
							<%

								for(int i=0;i<years.length;i++){
							%>						
									<option value='<%=years[i][0]%>' <%if(year.equals(years[i][0])) out.print("selected");%>><%=years[i][1]%></option>
							<%
								}
							%>
						</select>
						<select name="balancemonth21" >
							<option value=''>请选择&nbsp;</option>
							<%
								for(int i=0;i<months.length;i++){
							%>						
									<option value='<%=months[i][0]%>' <%if(month.equals(months[i][0])) out.print("selected");%>><%=months[i][1]%></option>
							<%
								}
							%>
						</select>

					</TD>
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(21,1)'>
					</td>
				</tr>
				<tr>
					<TD class="bg_column" align=center width='80'>采购单位</TD>
					<TD align=left class="bg_row_odd">
						<select name="deptid22">
												
						<%	

								if (operatorBean.getGs_oper_org_id().substring(2,4).equals("00"))
								{
							%>
									<option value='<%=operatorBean.getGs_oper_org_id()%>'>--全部--</option>
							<%
								}


						%>
                    		<%
                    		for(int i=0;i<deptList.size();i++){
                    			String dept = (String)deptList.get(i);
						        StringTokenizer st = new StringTokenizer(dept,"|");
						        String[] tmp = new String[2] ;
						        int index =0;
						        while(st.hasMoreElements()){
						            tmp[index++] = (String)st.nextElement();
						        }
                    		%>
                        		<option value='<%=tmp[0]%>' ><%=tmp[1]%></option>
                    		<%
                    		}
                    		%>					
						</select>
					</TD>

					<TD class="bg_column" align=center>选择时间段</TD>					
					<TD align=left class="bg_row_odd">
						<input type="text" onfocus='setday(this)' name="balancestartdate22" size='10' value="<%=balanced[0]%>">
						~
						<input type="text" onfocus='setday(this)' name="balanceenddate22" size='10' value="<%=balanced[1]%>">
					</TD>										
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(22,1)'>
					</td>
				</TR>
			</table>
		</td>
	</tr>
</table>
<BR>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black2">供应商供应明细表</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<BR>
	
	<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center width='80'>供应商</TD>
					<TD align=left class="bg_row_odd">
						<input type="text" name="providerid31" size='13' >&nbsp;<font color='red'>*</font>
					</TD>
					<TD class="bg_column" align=center>选择结算月份</TD>
					<TD align=left class="bg_row_odd">
						<select name="balanceyear31" >
							<option value=''>请选择&nbsp;</option>
							<%

								for(int i=0;i<years.length;i++){
							%>						
									<option value='<%=years[i][0]%>' <%if(year.equals(years[i][0])) out.print("selected");%>><%=years[i][1]%></option>
							<%
								}
							%>
						</select>
						<select name="balancemonth31" >
							<option value=''>请选择&nbsp;</option>
							<%
								for(int i=0;i<months.length;i++){
							%>						
									<option value='<%=months[i][0]%>' <%if(month.equals(months[i][0])) out.print("selected");%>><%=months[i][1]%></option>
							<%
								}
							%>
						</select>

					</TD>
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(31,2)'>
					</td>
				</tr>
				<tr>
					<TD class="bg_column" align=center width='80'>供应商</TD>
					<TD align=left class="bg_row_odd">
						<input type="text" name="providerid32" size='13' >&nbsp;<font color='red'>*</font>
					</TD>

					<TD class="bg_column" align=center>选择时间段</TD>					
					<TD align=left class="bg_row_odd">
						<input type="text" onfocus='setday(this)' name="balancestartdate32" size='10' value="<%=balanced[0]%>">
						~
						<input type="text" onfocus='setday(this)' name="balanceenddate32" size='10' value="<%=balanced[1]%>">
					</TD>										
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(32,2)'>
					</td>
				</TR>
			</table>
		</td>
	</tr>
</table>
<BR>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black2">供应商供应汇总表</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<BR>
	<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center width='80'>供应商</TD>
					<TD align=left class="bg_row_odd">
						<input type="text" name="providerid41" size='13' >&nbsp;<font color='red'>*</font>
					</TD>

					<TD class="bg_column" align=center>选择结算月份</TD>
					<TD align=left class="bg_row_odd">
						<select name="balanceyear41" >
							<option value=''>请选择&nbsp;</option>
							<%

								for(int i=0;i<years.length;i++){
							%>						
									<option value='<%=years[i][0]%>' <%if(year.equals(years[i][0])) out.print("selected");%>><%=years[i][1]%></option>
							<%
								}
							%>
						</select>
						<select name="balancemonth41" >
							<option value=''>请选择&nbsp;</option>
							<%
								for(int i=0;i<months.length;i++){
							%>						
									<option value='<%=months[i][0]%>' <%if(month.equals(months[i][0])) out.print("selected");%>><%=months[i][1]%></option>
							<%
								}
							%>
						</select>

					</TD>
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(41,2)'>
					</td>
				</tr>
				<tr>
					<TD class="bg_column" align=center width='80'>供应商</TD>
					<TD align=left class="bg_row_odd">
						<input type="text" name="providerid42" size='13' >&nbsp;<font color='red'>*</font>
					</TD>

					<TD class="bg_column" align=center>选择时间段</TD>					
					<TD align=left class="bg_row_odd">
						<input type="text" onfocus='setday(this)' name="balancestartdate42" size='10' value="<%=balanced[0]%>">
						~
						<input type="text" onfocus='setday(this)' name="balanceenddate42" size='10' value="<%=balanced[1]%>">
					</TD>										
					<TD align=left class="bg_row_odd">
						<input type="button" name="button1" class='kuang' value="生成报表" onclick='process(42,2)'>
					</td>
				</TR>
			</table>
		</
	</tr>
</table>
<BR>
<BR>
<BR>
</form>

</body>
</html>